package org.thanos.demo.controller;

import org.thanos.demo.producer.DemoProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DemoController {

    @Autowired
    private DemoProducer demoProducer;

    @GetMapping("/{message}")
    public void producer(@PathVariable("message") String message) {
        demoProducer.sendToMqtt(message);
    }
}
